<?php

/**
 * level actions.
 *
 * @package    elearning
 * @subpackage level
 * @author     Dvquan
 * @version		1.00.00
 * @Created		09.08.2010
 * @Update
 */
class levelstudykitActions extends sfActions
{
  public function executeIndex(sfWebRequest $request)
  {
	$lang_current = sfContext::getInstance()->getUser()->getCulture();
    //$this->level_list = LevelPeer::doSelect(new Criteria());
	$actionPage = $this->getRequestParameter('page', 1);
	$this->pager =  LevelStudyKitPeer::getListLevelKitWithLevel( $request->getParameter('levelid',0), $lang_current, $actionPage, 10 );
	$this->rows = $this->pager->getResults();
	$this->coursename = LevelPeer::getCourseNamebyCourseId($request->getParameter('courseid',0), $lang_current);
	$this->levelname = LevelStudyKitPeer::getLevelNameById($request->getParameter('levelid',0));
	//set session variable phan nay login vao thi set. THIS IS TEST
	$this->getUser()->setAttribute('isPermit','0');
	//o template thi $sf_user->getAttribute('isPermit')
  }

  public function executeShow(sfWebRequest $request)
  {
	//'/uploads/assets/levelstudykit/'.$this->getPicPath().'/thumb_'.$this->getObject()->getLskImage()
  /*
	//getListLevelByprimary
	$lang_current = sfContext::getInstance()->getUser()->getCulture();
    $this->level = LevelPeer::getListLevelByprimary($request->getParameter('id'));
    $this->forward404Unless($this->level);
	//get classes with level
	$this->classes = LevelPeer::getClassesWithLevel( $request->getParameter('id') );
	$this->coursename = LevelPeer::getCourseNamebyCourseId($request->getParameter('courseid',1), $lang_current);
	*/
  }
}
